package com.fzy.core;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.PreparedStatementCreator;

public class MyPreparedStatementCreator implements PreparedStatementCreator {

	private final String sql;

	public MyPreparedStatementCreator(String sql) {
		this.sql = sql;
	}

	public PreparedStatement createPreparedStatement(Connection con)
			throws SQLException {
		return con.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE,
				ResultSet.CONCUR_READ_ONLY);
	}

	public String getSql() {
		return this.sql;
	}

}
